SD CARD Q&A

Q1: SSD210 开发板如何支持SD card?

因为SSD210是QFN68, Pin脚有限,SD card和LCD有共用pin。当前软件默认是配置TTL panel,所以不支持SD card。

68Pin黄色板子的硬件需要对SD_CLK/SD_CMD/SD_D0/SD_D1/SD_D2/SD_D3加上拉电阻R178~R183,demo板默认NC。

若需要SD card,可以参照如下修改:

  1. DTS相关配置

    arch/arm/boot/dts/pioneer3-ssc021a-s01a-demo-padmux.dtsi
    

    下面这个#if 0 改为#if 1

    arch/arm/boot/dts/pioneer3-ssc021a-s01a-demo.dts
    

    下面mark的地方重新打开

  2. 硬件更改请参考QFN68 Demo Board TF Card(SDIO) Rework Note

Q2:  硬件上没有配置或者没有用到检测脚(CDZ), 该如何配置?

Kernel更改如下:

请把dts

slot-fakecdzs = <0>,<0>,<0>;

更改为

slot-fakecdzs = <1>,<0>,<0>;

Uboot更改:

合并如下commit添加并打开SDMMC_FAKE_CDZ

diff --git a/drivers/mstar/Kconfig b/drivers/mstar/Kconfig
index bd567d4..cd8f1c1 100755
--- a/drivers/mstar/Kconfig
+++ b/drivers/mstar/Kconfig
@@ -20,6 +20,10 @@
config MS_SDMMC
    bool 'MSTAR SDMMC'

+config SDMMC_FAKE_CDZ
+    depends on MS_SDMMC
+    bool 'FAKE_CDZ'
+
config MS_EMMC
    bool 'MSTAR eMMC'

diff --git a/drivers/mstar/sdmmc/ms_sdmmc_drv.c b/drivers/mstar/sdmmc/ms_sdmmc_drv.c
index b55a775..96c9681 100755
--- a/drivers/mstar/sdmmc/ms_sdmmc_drv.c
+++ b/drivers/mstar/sdmmc/ms_sdmmc_drv.c
@@ -666,8 +666,11 @@
    //IPEmType eIP = ge_IPSlot[u8Slot];

    SDMMC_SwitchPAD(u8Slot);
-
-   return Hal_CARD_GetGPIOState((GPIOEmType)u8Slot);
+#ifdef CONFIG_SDMMC_FAKE_CDZ
+    return TRUE;
+#else
+    return Hal_CARD_GetGPIOState((GPIOEmType)u8Slot);
+#endif
}

diff --git a/drivers/mstar/sdmmc/ms_sdmmc_ub.c b/drivers/mstar/sdmmc/ms_sdmmc_ub.c
old mode 100644
new mode 100755
index 548923e..a44409e
--- a/drivers/mstar/sdmmc/ms_sdmmc_ub.c
+++ b/drivers/mstar/sdmmc/ms_sdmmc_ub.c
@@ -101,7 +101,11 @@
//------------------------------------------------------------------------------------------------
static U8_T _CardDetect(SlotEmType eSlot)
{
+#ifdef CONFIG_SDMMC_FAKE_CDZ
+    return TRUE;
+#else
    return Hal_CARD_GetGPIOState((GPIOEmType)eSlot);
+#endif
}

...